package com.groupbuying.customer.dao;

import com.groupbuying.customer.domain.CustomerPrizeDO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 中奖表
 * @author gaoruijun
 * @email 18511893135@163.com
 * @date 2019-07-30 10:25:17
 * @des
 */

@Mapper
@Repository
public interface CustomerPrizeDao {

	CustomerPrizeDO get(String uuid);
	
	List<CustomerPrizeDO> list(Map<String, Object> map);
	
	int count(Map<String, Object> map);
	
	int save(CustomerPrizeDO customerPrize);
	
	int update(CustomerPrizeDO customerPrize);
	
	int remove(String uuid);
	
	int batchRemove(String[] uuids);

	/**
	 * 获取所有中奖信息
	 * @return
	 */
	List<CustomerPrizeDO> getPrizeDetails(String source);

	/**
	 * 查询手机号
	 * @return
	 */
	Set<String> getMobile(String type);

	/**
	 * 查询总数
	 * @param param
	 * @return
	 */
	Integer sumPrize(Map<String,String> param);

	Integer sumEvenPrize(Map<String,String> map);

	/**
	 * 转盘详情
	 * @param source
	 * @return
	 */
	List<CustomerPrizeDO> getPrizeFormSource(String source);

	/**
	 *大屏幕抽奖详情
	 * @param type
	 * @return
	 */
	List<CustomerPrizeDO> getPrizeFormType(String type);

	/**
	 * 根据customerId和source查询抽奖次数
	 * @param map
	 * @return
	 */
	Integer getTimeBySourceAndMobile(Map<String,String> map);

}
